<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        // \d   数字
        // \D   非数字

        // \w  数字，字母，下划线
        // \W  非数字字母下划线

        // \s  匹配空白字符  --- 匹配空格
        // \S  匹配非空白字符  --- 非空格


        // 中文字匹配
        //   [\u4e00-\u9fa5]


        // .  匹配任意字符

        var reg = /\D/;
        console.log(reg.test('12345,'));


        var reg = /^\w{5}$/;
        console.log(reg.test('12_wQ'));

        var reg = /^\S$/;
        console.log(reg.test('a'));

        var reg = /[\u4e00-\u9fa5]/;
        console.log(reg.test('defev12啊'));


        var reg = /./;
        console.log(reg.test('ddd'));

    </script>

</body>

</html>